﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Com.CMS263.BLL;
using Com.CMS263.PO;
using Com.CMS263.Util;

namespace Com.CMS263.Web.manage
{
    //public partial class manage_guest : System.Web.UI.Page
    //{
    //    public static int id = 0;
    //    GuestBLL bll = new GuestBLL();
    //    DealBLL dbll = new DealBLL();
    //    public int type = 0;
    //    int pageSize = 10;
    //    public static  int pageCount = 0;
    //    public int CurrentIndex
    //    {
    //        get { return Convert.ToInt32(ViewState["index"]); }
    //        set { ViewState["index"] = value; }
    //    }
    //    protected void Page_Load(object sender, EventArgs e)
    //    {
    //        if (!Page.IsPostBack)
    //        {
    //            BindData();
    //        }
    //    }
    //    public void BindData()
    //    {
    //        CurrentIndex = Convert.ToInt32(Request.QueryString.Get("page"));
    //        if (CurrentIndex == 0)
    //        {
    //            CurrentIndex = 1;
    //        }
    //        IList<Guest> newslist = new List<Guest>();
    //        newslist = bll.GetGuestList(pageSize,CurrentIndex);
    //        pageCount = bll.GetTotalNum();
    //        GridView1.DataSource = newslist;
    //        GridView1.DataBind();
    //    }

    //    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    //    {

    //        id = Convert.ToInt32(e.CommandArgument);
    //        if (e.CommandName.Equals("btnDel"))
    //        {
    //            try
    //            {
    //                Guest guest = bll.GetGuestById(id);
    //                dbll.DeleteAllDealByUserId(guest.userId);
    //                MessageBLL mbll = new MessageBLL();
    //                mbll.DeleteMessageByuserId(guest.id);
    //                bll.DeleteGuestByID(id); ScriptManager.RegisterClientScriptBlock(this, GetType(), "js", "alert('删除成功')", true);
    //            }
    //            catch
    //            {

    //                ScriptManager.RegisterClientScriptBlock(this, GetType(), "js", "alert('删除失败')", true);
    //            }

    //            BindData();
    //        }
    //        else if (e.CommandName.Equals("btnEdit"))
    //        {
    //            Response.Redirect("add_guest.aspx?id="+id+"&page="+CurrentIndex);
    //        }
    //        else if (e.CommandName.Equals("btnDeal"))
    //        {
    //            Response.Redirect("manage_deal.aspx?user=" + id+"&gpage="+CurrentIndex);
    //        }
    //        else if (e.CommandName.Equals("btnRen"))
    //        {
    //            Response.Redirect("add_deal.aspx?user=" + id + "&page=" + CurrentIndex);
    //        }
    //        else if (e.CommandName.Equals("btnShu"))
    //        {
    //            Response.Redirect("add_shu.aspx?user=" + id + "&page=" + CurrentIndex);
    //        }
    //        else if (e.CommandName.Equals("btnFH"))
    //        {
    //            Response.Redirect("add_fenhong.aspx?user=" + id + "&page=" + CurrentIndex);
    //        }


    //    }
    //    public string GetPager()
    //    {

    //        return Pager.GetPager(pageCount, pageSize, CurrentIndex, type.ToString());
    //    }

    //    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    //    {
    //        BindData();
    //    }

        
    //}
}
